package se.grp03.fmtuner.scheduler.io;

import java.util.Scanner;

public class StdioAdapter extends UdpAdapter {

	private Scanner input = new Scanner(System.in);
	//private String port;
	private String data;
	
	public StdioAdapter(int port) {
		super(port);
	}
	
	public StdioAdapter(String ip, int port) {
		super(ip, port);
	}
    
    @Override
    public void doOpen() {
		System.out.println("** Opened connection on UDP Port: " + port);
    }

    @Override
    public String doRead() {
    	System.out.print("-> Enter message: ");
    	data = input.nextLine();
    	return data;
    }

    /*@Override
    public void doWrite(String msg) {
    	System.out.println("<- Outgoing Message [" + port + "]: " + msg);
    }*/

    @Override
    public void doClose() {
    	System.out.println("** Closed connection on UDP Port: " + port);
    }
}